package com.sfx.controller;

import com.sfx.model.User;
import com.sfx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;


@Controller
public class TestController {
//在 Spring 项⽬中，通过 main ⽅法获取到 Controller 类，调⽤ Controller ⾥⾯通过注⼊的⽅式调⽤
//Service 类，Service 再通过注⼊的⽅式获取到 Repository 类，Repository 类⾥⾯有⼀个⽅法构建⼀
//个 User 对象，返回给 main ⽅法。Repository ⽆需连接数据库，使⽤伪代码即可
    @Autowired
    private UserService service;

    public User doTestController(){
        return service.doUserService();
    }
}
